Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds a GitHub Actions workflow that automatically assigns one random reviewer from the eng team plus a fixed reviewer on new pull requests.
- Introduces
.github/workflows/random-reviewer-assignment.yml - Uses
actions/github-script@v6to list team members, exclude the author, pick one at random, and request reviews
Comments suppressed due to low confidence (5)
.github/workflows/random-reviewer-assignment.yml:6
- GitHub API call to list organization members requires explicit permission scope; add a
permissions: members: readblock to ensure GITHUB_TOKEN can list org team members.
env:
.github/workflows/random-reviewer-assignment.yml:21
- [nitpick] Hard-coded
team_slug: 'eng'makes this workflow less reusable; consider parameterizing the organization and team slug via inputs or environment variables.
team_slug: 'eng'
.github/workflows/random-reviewer-assignment.yml:29
- [nitpick] The exclusion of a specific user (
"lagoja") is hard-coded; it would be clearer to move this into a configurable list or input to avoid future edits in code.
.filter(login => login !== "lagoja");
.github/workflows/random-reviewer-assignment.yml:44
- Always requesting a review from
"lagoja"may assign the PR author if they arelagoja; add a conditional to skip adding the fixed reviewer when they are the author.
reviewers: [randomReviewer, "lagoja"]
.github/workflows/random-reviewer-assignment.yml:48
- Use
core.setFailed(error.message)in a GitHub Actions script rather thanconsole.error, so the step properly fails and downstream steps stop.
console.error('Error assigning reviewer:', error);
…n permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: John Lago <750845+Lagoja@users.noreply.github.com>
mikeland73
approved these changes
Jul 2, 2025
Comment on lines
+29
to
+33
| const prAuthor = context.payload.pull_request.user.login; | ||
| const eligibleReviewers = teamMembers.data | ||
| .map(member => member.login) | ||
| .filter(login => login !== prAuthor) | ||
| .filter(login => login !== "lagoja"); |
Collaborator
There was a problem hiding this comment.
should we skip auto-assignment is author is on team?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TSIA, add myself + 1 random reviewer from our eng org.
How was it tested?
Community Contribution License
All community contributions in this pull request are licensed to the project
maintainers under the terms of the
Apache 2 License.
By creating this pull request, I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 License as stated in
the
Community Contribution License.